package com.email.box.controller;

import com.email.box.entity.po.SysUserInfoPO;
import com.email.box.entity.vo.GetSysUserInfoListVO;
import com.email.box.entity.dto.SaveSysUserInfoDTO;
import com.email.box.entity.dto.DeleteCommonDTO;
import com.email.box.service.ISysUserInfoService;
import com.email.box.common.vo.RespVO;
import io.swagger.annotations.Api;
import com.email.box.common.vo.FilteredParameter;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;


import javax.validation.Valid;
import java.util.List;

/**
 * <p>
 * 用户表 前端控制器
 * </p>
 *
 * @author xuan
 * @since 2021-12-15
 */
@Api(tags = "用户表")
@RestController
@RequestMapping("/box/sys-user-info-po")
public class SysUserInfoController {

    @Resource
    ISysUserInfoService iSysUserInfoService;

    @ApiOperation(value = "查用户表列表")
    @GetMapping("get-list")
    public RespVO<List<GetSysUserInfoListVO>> getSysUserInfoList(FilteredParameter dto) {
        return iSysUserInfoService.getSysUserInfoList(dto);
    }

    @ApiOperation(value = "新增用户表")
    @PostMapping("add")
    public RespVO<Object> addSysUserInfo(@Valid @RequestBody SaveSysUserInfoDTO dto) {
        return iSysUserInfoService.addSysUserInfo(dto);
    }

    @ApiOperation(value = "修改用户表")
    @PostMapping("update")
    public RespVO<Object> updateSysUserInfo(@Valid @RequestBody SaveSysUserInfoDTO dto) {
        return iSysUserInfoService.updateSysUserInfo(dto);
    }

    @ApiOperation(value = "新增或修改用户表信息")
    @PostMapping("save")
    public RespVO<Object> saveSysUserInfo(@Valid @RequestBody SaveSysUserInfoDTO dto) {
        return iSysUserInfoService.saveSysUserInfo(dto);
    }

    @ApiOperation(value = "删除用户表")
    @PostMapping("removes")
    public RespVO<Object> removesSysUserInfo(@Valid @RequestBody DeleteCommonDTO dto) {
        return iSysUserInfoService.removesSysUserInfo(dto);
    }
}
